package com.luoc.base.controller;

import com.luoc.base.model.Result;
import com.luoc.base.redis.RedisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: luoc
 * @Date: 2019/7/23 15:45
 */
@RestController
@RequestMapping("redis")
@Api(value = "redis操作", tags = {"缓存模块"})
@Slf4j
public class RedisController {

    @Autowired
    private RedisService redisService;

    @GetMapping("/setKey")
    @ApiOperation(value = "redis存入String", notes = "传入orderId")
    public Result setString(@RequestParam String OrderId) {
        redisService.set("orderId", OrderId);
        return Result.ok("success");
    }
}
